//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package ccy.ccybanarmorinfinity.listener;

import ccy.ccykills.event.KillPlayerEvent;
import ccy.ccylibrary.plugin.annotation.Event;
import morph.avaritia.handler.AvaritiaEventHandler;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.FMLCommonHandler;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

@Event
public class KillPlayerListener implements Listener {
    public KillPlayerListener() {
    }

    @EventHandler
    public void onKill(KillPlayerEvent event) {
        EntityPlayerMP player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerByUUID(event.getPlayer().getUniqueId());
        if (AvaritiaEventHandler.isInfinite(player)) {
            event.setCancelled(true);
        }

    }
}
